package demo3;

/**
 * @Author 12629
 * @Description：
 */
class Student {
    public void test() {
        System.out.println("Student::test()");
    }
}
interface IA {
    void testA();
}
public class Test {

    public static void func() {
        IA ia = new IA() {
            @Override
            public void testA() {
                System.out.println("testA()...");
            }
        };
        ia.testA();
    }

    public static void func1() {
        Student student = new Student(){
            @Override
            public void test() {
                System.out.println("重写test()方法...");
            }

            public void test2() {
                System.out.println("test2()...");
            }
        };
        student.test();

    }

    public static void main(String[] args) {
        func();
    }
}
